package it.aekidna.cleverplatypus.mediator
{
	import flash.utils.getQualifiedClassName;
	
	import mx.logging.ILogger;
	import mx.logging.Log;
	
	import org.springextensions.actionscript.ioc.factory.config.IObjectPostProcessor;
	
	public class MediateMetaTagPostProcessor implements IObjectPostProcessor
	{
		private static const LOGGER : ILogger = 
			Log.getLogger( getQualifiedClassName( MediateMetaTagPostProcessor ).replace(/:+/g, "." ) );
		
		public function MediateMetaTagPostProcessor()
		{
		}

		/**
		 * Mediate metadata has the following parameters:
		 * - event (String) : the type of the dispatched event
		 * - args (String arrays) : the ordered target method's arguments
		 * 	 to be copied from the event object. Ignored if the dispatched
		 *   CommandEvent's args array is populated. 
		 * 
		 * [Mediate(
		 * 		event="GET_USER_BY_FIRST_LAST",
		 * 		args="firstName,lastName" 
		 * 		)
		 * ]
		 * 
		 * @see it.aekidna.cleverplatypus.mediator.MediationRegistry
		 */	
		public function postProcessBeforeInitialization(
			inObject : *, 
			inObjectName : String ) : *
		{
			MetadataUtil.processMediateMetaTags( inObject ); 
		}
		
		public function postProcessAfterInitialization(object:*, objectName:String):*
		{
			return null;
		}

	}
}